package com.qqbot.impl.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.qqbot.core.message.MessageChain;
import com.qqbot.core.message.support.ImageMessage;
import com.qqbot.impl.service.DuJiaoShouApiService;
import com.qqbot.impl.service.YouKeApiService;
import com.qqbot.impl.utils.HttpClientUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.text.MessageFormat;

/**
 * 优客API服务接口
 *
 * @author changwenpeng
 * @date 2022年5月9日
 */
@Slf4j
@Service
public class YouKeApiServiceImpl implements YouKeApiService {


    @Override
    public String randomMsg() {
        try {
            String url = "https://api.iyk0.com/gsyy/";
            String resJson = HttpClientUtils.get(url, 10000, 10000);
            return resJson.replaceAll("\\n", "");
        }catch (Exception e){
            return "";
        }
    }
}
